#ifndef __LIB_UVIEW_H
#define __LIB_UVIEW_H

#include"uview_bitmap.h"
#include"uview_msg.h"
#include"uview_keycode.h"
#include"uview_mouse.h"
#include"uview_color.h"
#include"uview_shape.h"
#include"uview_io.h"

//view type
typedef enum uview_type
{
    UVIEW_TYPE_FIXED=0,
    UVIEW_TYPE_WINDOWS,
    UVIEW_TYPE_FLOAT,
}uview_type_t;

//view attr
typedef enum uview_attr
{
    UVIEW_ATTR_RESIZEABLE=0x01,
    UVIEW_ATTR_MOVEABLE=0x02,
}uview_attr_t;

//view timer 
typedef struct 
{
    uint64_t timer_id;
    uint64_t interval; 
}uview_timer_t;

//view max size 
#define UVIEW_MAX_SIZE_WIDTH 1920
#define UVIEW_MAX_SIZE_HEIGHT 1080

//view timer max
#define UVIEW_TIMER_MIN 0x0000000A
#define UVIEW_TIMER_MAX 0x7fffffff

#define UVIEW_BAD_ID(view) ((view)<0)

int uview_open_tmp();
int uview_open(int width, int height, int type);
int uview_close(int fd);
int uview_set_pos(int fd, int x, int y);
int uview_get_pos(int fd, int *x, int *y);
int uview_set_size_min(int fd, int width, int height);
int uview_set_type(int fd, int type);
int uview_set_moveable(int fd);
int uview_set_unmoveable(int fd);
int uview_set_resizeable(int fd);
int uview_set_unresizeable(int fd);
int uview_set_nowait(int fd, int is_nowait);
int uview_set_monitor(int fd, int is_montor);
int uview_show(int fd);
int uview_hide(int fd);
int uview_setz(int fd,int z);
int uview_get_screensize(int fd, int *width, int *height);
int uview_resize(int fd, int width, int height);
int uview_update(int fd, int left, int top, int right, int bottom);
int uview_set_drag_region(int fd, int left, int top, int right, int bottom);
int uview_add_timer(int fd,uint64_t interval);
int uview_del_timer(int fd,uint64_t timer_id);
int uview_bitblt(int fd, int vx, int vy, uview_bitmap_t *bmp);
int uview_bitblt_update(int fd, int vx, int vy, uview_bitmap_t *bmp);
int uview_bitblt_ex(int fd, int vx, int vy, uview_bitmap_t *bmp, int bx, int by, int bw, int bh);
int uview_bitblt_update_ex(int fd, int vx, int vy, uview_bitmap_t *bmp, int bx, int by, int bw, int bh);
int uview_get_msg(int fd, uview_msg_t *msg);
int uview_send_msg(int fd, uview_msg_t *msg);
int uview_get_vid(int fd, int *vid);
int uview_get_lastpos(int fd, int *x, int *y);
int uview_get_mousepos(int fd, int *x, int *y);
int uview_add_timer(int fd, uint64_t interval);
int uview_del_timer(int fd, uint64_t timer_id);
int uview_restart_timer(int fd, uint64_t timer_id, uint64_t interval);
int uview_repair_size(int *width, int *height);
int uview_set_win_maxim_rect(int fd, int x, int y, int width, int height);
int uview_get_win_maxim_rect(int fd, int *x, int *y, int *width, int *height);

#endif 